﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<kysec.RAL.EFToMySql.tb_userinfo>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>完善资料</title>
     <link href="../../Content/back/css/op.css" rel="stylesheet" type="text/css" />
<%--    <script src="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Scripts/jquery-1.4.1.min.js") %>" type="text/javascript"></script> 
    <script src="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Scripts/ajaxfileupload.js") %>" type="text/javascript"></script>  --%>
    <script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../../Scripts/ajaxfileupload.js" type="text/javascript"></script>
    <link href="../../Content/back/css/validator.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/formValidator.js" type="text/javascript"></script>
    <link href="../../Content/back/css/skin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

        $(function () {
            $.formValidator.initConfig({ formid: "form1", onsuccess: function () { return true; }, onerror: function (msg) { return false; } });
            $("#txtTitle").formValidator({ tipid: "txtTitleTip", onshow: "     请输入资讯标题", onfocus: "     请输入资讯标题", oncorrect: " 输入正确" }).inputValidator({ min: 1, max: 100, onerror: "     输入有误" });
            $("#txtFrom").formValidator({ tipid: "txtFromTip", onshow: "     请输入资讯来源", onfocus: "     请输入资讯来源", oncorrect: " 输入正确" }).inputValidator({ min: 1, max: 100, onerror: "     输入有误" });
            $("#txtemail").formValidator({ onshow: "输入您的电子邮箱", onfocus: "输入您的电子邮箱", oncorrect: "验证通过" }).inputValidator({ min: 3, max: 30, onerror: "邮箱地址长度错误" }).regexValidator({ regexp: "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*", onerror: "格式错误" });
            $("#txtpassword").formValidator({ onshow: "请输入您的密码", onfocus: "密码长度6-12位", oncorrect: "验证通过" }).inputValidator({ min: 6, max: 12, onerror: "密码长度错误" }).regexValidator({ regexp: "\\w{6,12}", onerror: "格式错误" });
            $("#txtcmfpsd").formValidator({ onshow: "再次输入您的密码", onfocus: "再次输入您的密码", oncorrect: "验证通过" }).inputValidator({ min: 6, max: 12, onerror: "两次输入不一致" }).compareValidator({ desid: "txtpassword", operateor: "=", onerror: "2次密码不一致,请确认" });
        });
        function submitForm() {
            if (true) {
                $.ajax({
                    url: "/User/FinishUserInfo",
                    type: "post",
                    cache: false,
                    data: "userId=" + $("#userId").val() + "&c_nvc_sex=" + $("[name=c_nvc_sex]:checked").val() + "&c_i_age=" + $("#c_i_age").val() + "&c_vc_mobile=" + $("#c_vc_mobile").val() + "&c_vc_phone=" + $("#c_vc_phone").val() + "&c_vc_qq=" + $("#c_vc_qq").val() + "&c_vc_msn=" + $("#c_vc_msn").val() + "&c_nvc_address=" + $("#c_nvc_address").val() + "&c_nvc_realname=" + $("#c_nvc_realname").val(),
                    success: function (result) {
                        if (result == "0") {
                            alert("修改失败！");
                        } else if (result == "1") {
                            alert("修改成功！");
                            window.location.href = "<%=kysec.CR.MyUrl.WebData.WEBURL %>/User/InfoList";
                        } else if (result == "2") {
                            alert("修改时发生异常！");
                        }
                    }
                });
            }
        }        
</script>
</head>
<body>
    <div>
 <% string userId = Request.QueryString["userId"].ToString(); %>
 <input type="hidden" name="userId" id="userId" value ="<%=userId %>" />

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_leftbg.gif") %>"><img src="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/left-top-right.gif") %>" width="17" height="29" /></td>
    <td width="100%" height="29" valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/content-bg.gif") %>"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">完善资料</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_rightbg.gif") %>"><img src="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/nav-right-bg.gif") %>" width="16" height="29" /></td>
  </tr>

  <tr>
    <td height="71" valign="middle" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_leftbg.gif") %>">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><table border="0" cellpadding="0" cellspacing="0"> 
     <tr>
            <td class="left_txt">当前位置：<a href="<%:kysec.CR.MyUrl.WebData.WEBURL %>/User/InfoList">用户管理</a> >> 完善用户资料</td>
      </tr></table>
   <div style="background-color:#97b9f0;height:1px;margin-bottom:10px;"></div>
    
        <div style="text-align:center;">
        
        <fieldset style="width:95%;">
            <legend>正在完善&nbsp;&nbsp;<span style="color:Green"><%=kysec.Bll.User.common.getUserNameById(userId) %></span>&nbsp;&nbsp;详细资料</legend>           
            <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr><td colspan="6" width="100%"><table width="100%" border="0" cellpadding="0" cellspacing="0" >
              <tr><td width="75%"><table width="100%" border="0" cellpadding="0" cellspacing="0">
               <tr style="height:40px;" bgcolor="#d3ebf8">
                <td width="10%"><div><label>真实姓名</label></div></td>
                <td width="30%" align="left"><div class="td_Left"><input type="text" id="c_nvc_realname" name="c_nvc_realname" size="20" /></div></td>
                <td align="left"><span class="c_red" id="c_nvc_realnameTip">用户号必须使用字母和数字</span></td>
            </tr>
              
               <tr  style="height:40px;" bgcolor="#97b9f0">
                <td width="10%"><div><label>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</label></div></td>
                <td width="30%" align="left"><div class="td_Left"><input type="radio" name="c_nvc_sex" checked="checked" value="男"/>男
                <input type="radio" name="c_nvc_sex" value="女"/>女</div></td>
                <td align="left"></td>
            </tr>
                
               <tr  style="height:40px;" bgcolor="#d3ebf8">
                <td width="10%"><div><label>年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;龄</label></div></td>
                <td width="30%" align="left"><div class="td_Left"><input type="text" id="c_i_age" name="c_i_age" size="20" /></div></td>
                <td align="left"><span class="c_red" id="c_i_ageTip">用户号必须使用字母和数字</span></td>
            </tr></table></td>           
            <td width="25%"><div><img alt="头像" src="<%:Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/UserPhoto/nophoto.gif") %>" width="113" height="117"/></div><div style="margin-top:5px;">

            <form runat="server" id="form1" action="/User/Upload" enctype="multipart/form-data" method="post"><div><span><input type="hidden" name="userIdImg" id="userIdImg" value ="<%=Request.QueryString["userId"].ToString() %>" /><input type="file" id="img" name="img" size="22"/></span><span><input type="submit" value="上传" /></span></div></form>           
            
            </div></td></tr>
            </table></td></tr>

            <tr style="height:50px; margin-top:10px" bgcolor="#97b9f0">
                <td width="10%"><div><label>移动电话</label></div> </td>
                <td align="left"><div class="td_Left"><input type="text" id="c_vc_mobile" name="c_vc_mobile" size="22" /></div></td>
                <td align="left"><span class="c_red" id="c_vc_mobileTip">使用区号加座机号，如：0773-1111111</span></td>
                <td width="10%"><div><label>手记号码</label></div> </td>
                <td align="left"><div class="td_Left"><input type="text" id="c_vc_phone" name="c_vc_phone" size="22" /></div></td>
                <td align="left"><span class="c_red" id="c_vc_phoneTip">长度不能少于11位</span></td>
            </tr>

             <tr style="height:50px;" bgcolor="#d3ebf8">
                <td width="10%"><div><label>QQ</label></div> </td>
                <td align="left"><div class="td_Left"><input type="text" id="c_vc_qq" name="c_vc_qq" size="22" /></div></td>
                <td align="left"><span class="c_red" id="c_vc_qqTip">格式为：1111111</span></td>
                <td width="10%"><div><label>MSN</label></div> </td>
                <td align="left"><div class="td_Left"><input type="text" id="c_vc_msn" name="c_vc_msn" size="22" /></div></td>
                <td align="left"><span class="c_red" id="c_vc_msnTip">格式为：msn@msn.cn</span></td>
            </tr>
           
            <tr style="height:50px;" bgcolor="#97b9f0">
                <td  width="10%"><div><label>详细地址</label></div> </td>
                <td  align="left" colspan="3"><div class="td_Left"><input type="text" id="c_nvc_address" name="c_nvc_address"  size="100" /></div></td>
                <td  align="left" colspan="2"><span class="c_red" id="c_nvc_addressTip">具体到街巷名称</span></td>
            </tr>            
            </table>
            <p>
                <a href="javascript:;" onclick="submitForm();">确认添加</a>
                <a href="javascript:;" onclick="resetForm();" style="margin:0px 20px 0px 20px;">重置</a>
                <a href="<%:kysec.CR.MyUrl.WebData.WEBURL %>/User/InfoList">返回</a>
            </p>
            
        </fieldset>
        </div>
     </td>
    <td  background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_rightbg.gif") %>">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_leftbg.gif") %>"><img src="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/buttom_left2.gif") %>" width="17" height="17" /></td>
      <td  valign="top" background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/buttom_bgs.gif") %>"><img src="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/buttom_bgs.gif") %>" width="17" height="17" /></td>
    <td background="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/mail_rightbg.gif") %>"><img src="<%=Url.Content(kysec.CR.MyUrl.WebData.WEBURL + "/Content/back/images/buttom_right2.gif") %>" width="16" height="17" /></td>
  </tr>
</table>   
    </div>
</body>
</html>
